package com.szq.pattern;

import com.szq.pattern.user.Student;
import com.szq.pattern.user.Teacher;
import com.szq.pattern.user.User;
import com.szq.pattern.visitor.Visitor;

import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: szq
 * @date: 2021-09-11 09:00:42
 */
public class DataViewer {

    List<User> userList = new ArrayList<>();

    public DataViewer(){
        userList.add(new Student("谢⻜机", "᯿点班", "⼀年⼀班"));
        userList.add(new Student("windy", "᯿点班", "⼀年⼀班"));
        userList.add(new Student("⼤⽑", "普通班", "⼆年三班"));

        userList.add(new Student("Shing", "普通班", "三年四班"));
        userList.add(new Teacher("BK", "特级教师", "⼀年⼀班"));
        userList.add(new Teacher("娜娜Goddess", "特级教师", "⼀年⼀班"));
        userList.add(new Teacher("dangdang", "普通教师", "⼆年三班"));
        userList.add(new Teacher("泽东", "实习教师", "三年四班"));
    }

    public void show(Visitor visitor){
        for(User user : userList){
            user.accept(visitor);
        }
    }
}
